package com.sky.config;

import com.sky.App2;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class CommonConfig2 {
    @Bean
    @ConditionalOnMissingBean(name = "app2_1")
    @ConditionalOnSingleCandidate(ApplicationContext.class)
    public App2 app2_1(ApplicationContext applicationContext) {
        return new App2();
    }
}
